﻿using UnityEngine;
using System.Collections;

namespace Lost{
	public class LightCtrl : MonoBehaviour {
		[SerializeField] Light[] lights;
		//亮度
		[SerializeField] float maxIntensity;
		[SerializeField] float minIntensity;

		public void OpenLight(){
			foreach (Light l in lights) {
				l.enabled = true;
			}
		}
		public void CloseLight(){
			foreach (Light l in lights) {
				l.enabled = false;
			}
		}
		public void ChangeLight(){
			foreach (Light l in lights) {
				l.enabled = !l.enabled;
			}
		}
		public void SetMaxIntensity(){
			foreach (Light l in lights) {
				l.intensity = maxIntensity;
			}
		}
		public void SetMinIntensity(){
			foreach (Light l in lights) {
				l.intensity = minIntensity;
			}
		}
		public void ChangeIntensity(){
			foreach (Light l in lights) {
				if (l.intensity == maxIntensity) {
					l.intensity = minIntensity;
				} else {
					l.intensity = maxIntensity;
				}
			}
		}
	}
}
